﻿using System;
using System.Collections.Generic;
using System.Text;
using Transcend.FileUploader.Entity;

namespace Transcend.FileUploader
{
	public class UploadSetting
	{

		public UploadSetting()
		{
			IsIncrementUpload = false;
			IgnoreError = false;
			ParseVolNo = true;
			ParseDocNo = true;
			ParseDocId = true;
			OverrideWarm = true;
			GenDsItemUseCatalog = false;
			OverrideAction = OverrideAction.MarkDocInstance;
			OverrideSetting = new OverrideSetting();

            isVolume = false;
            isCase = true;
            isAutoAdd = true;
		}

        /// <summary>
        /// 卷目录
        /// </summary>
        public bool isVolume { get; set; }
        /// <summary>
        /// 宗目录
        /// </summary>
        public bool isCase { get; set; }
        /// <summary>
        /// 是否自动新增数据
        /// </summary>
        public bool isAutoAdd { get; set; }

		/// <summary>
		/// 设置/获取是否为增量上传;默认:否
		/// </summary>
		public bool IsIncrementUpload { get; set; }

		public string DocInfoConnectionString { get; set; }

		public string StorageConnectionString { get; set; }

		public bool IgnoreError { get;set; }

		public bool ParseVolNo { get; set; }

		public bool ParseDocNo { get; set; }

		public bool ParseDocId { get; set; }

		/// <summary>
		/// 是否开启覆盖上传提示；默认:是
		/// </summary>
		public bool OverrideWarm { get; set; }

		/// <summary>
		/// 覆盖上传时执行的动作
		/// </summary>
		public OverrideAction OverrideAction { get; set; }

		public OverrideSetting OverrideSetting { get; set; }

		public DocStorageAppType AppType { get; set; }

		public bool GenDsItemUseCatalog { get; set; }

        /// <summary>
        /// 图形文件已加密
        /// </summary>
        public bool EncryptedImage { get; set; }

        /// <summary>
        /// 图形文件加密密码
        /// </summary>
        public string ImagePassword { get; set; }
	}

	public class OverrideSetting
	{
		public OverrideSetting()
		{
			NoConfirmAnyMore = false;
			ShouldOverride = false;
		}
		public bool NoConfirmAnyMore { get; set; }
		public bool ShouldOverride { get; set; }
	}

	/// <summary>
	/// 覆盖上传执行动作
	/// </summary>
	public enum OverrideAction
	{
		/// <summary>
		/// 标记dsinstance下的dspage为无效
		/// </summary>
		MarkDocPage,
		/// <summary>
		/// 标记dsinstance为删除
		/// </summary>
		MarkDocInstance,
		/// <summary>
		/// 物理删除dsinstance
		/// </summary>
		DeleteDocInstance,
		/// <summary>
		/// 物理删除dsitem、dspage
		/// </summary>
		DeleteDocPage
	}

}
